// user
export interface UserProps {
  username: string;
  email: string;
  avatar: string;
}

// storage
export interface IdcInfosProps {
  idc: string[];
  psm: string;
}

export interface StorageProps {
  storageUri: string;
  description: string;
  owners: string[];
  type: string;
  idcInfos: IdcInfosProps[];
}

// entity
export interface Enum {
  index: string;
  value: string;
}

export interface InnerField {
  name: string;
  type: string;
  description?: string;
  codec?: string;
  enum?: Enum[];
  itemType?: string;
  itemType2?: string;
  innerFields?: InnerField[];
}

export interface Field {
  name: string;
  type: string;
  description?: string;
  codec?: string;
  enum?: Enum[];
  itemType?: string;
  itemType2?: string;
  innerFields?: InnerField[];
}

export interface Index {
  fieldGroup: string[];
  primary: boolean;
  unique: boolean;
}

export interface EntityProps {
  entityName: string;
  description: string;
  owners: string[];
  fields: Field[];
  indexs: Index[];
}

// mapping
export interface Column {
  columnName: string;
  fieldName: string;
  columnType: string;
}

export interface MappingProps {
  entityName: string;
  storageUri: string;
  tableName: string;
  idcs: string[];
  columns?: Column[];
}

export interface EntityFormProps {
  entity: EntityProps;
  mapping: MappingProps;
}

export interface FieldAndColumn {
  fields: Field;
  columns: Column;
}

export interface EntityMysqlFormDataProps {
  baseInfo: {
    entityName: string;
    description: string;
    owners: string[];
    storageUri: string;
    tableName: string;
    idcs: string[];
  };
  fieldsAndColumns: FieldAndColumn[];
  indexs: Index[];
}

export interface EntityMongodbFormDataProps {
  baseInfo: {
    entityName: string;
    description: string;
    owners: string[];
    storageUri: string;
    tableName: string;
    idcs: string[];
  };
  fields: Field[];
  indexs: Index[];
}

// selectOption
export interface SelectOption {
  label: string;
  value: string;
}
